package com.axzhengxin.platform.afterloan.controller;

import com.axzhengxin.platform.afterloan.domain.FspBizLoanInfo;
import com.axzhengxin.platform.afterloan.service.IAfterLoanBizInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * AfterLoanBizLoanInfoController
 * 贷后管理模块全部放款、未结清放款信息端口
 *
 * @author jiangnan
 * @date 2021/3/4
 */
@Slf4j
@RestController
@RequestMapping(path = "/afterloan")
public class AfterLoanBizLoanInfoController extends BaseController {

    private IAfterLoanBizInfoService fspBizInfoService;

    public AfterLoanBizLoanInfoController(IAfterLoanBizInfoService fspBizInfoService) {
        this.fspBizInfoService = fspBizInfoService;
    }

   /* @PreAuthorize("@ss.hasPermi('afterloan:allloan:list')")*/
    @GetMapping(path = "/allloan/list")
    public TableDataInfo allLoan(FspBizLoanInfo fspBizLoanInfo) {
        startPage();
        List<FspBizLoanInfo> fspBizLoanInfoList = fspBizInfoService.selectAllFspBizLoanInfoList(fspBizLoanInfo);
        return getDataTable(fspBizLoanInfoList);
    }

    /*@PreAuthorize("@ss.hasPermi('afterloan:unsettledloan:list')")*/
    @GetMapping(path = "/unsettledloan/list")
    public TableDataInfo unsettledLoan(FspBizLoanInfo fspBizLoanInfo) {
        startPage();
        List<FspBizLoanInfo> fspBizLoanInfoList = fspBizInfoService.selectUnfinishedFspBizLoanInfoList(fspBizLoanInfo);
        return getDataTable(fspBizLoanInfoList);
    }

}
